#ifndef FRAMELESSWIDGET_H
#define FRAMELESSWIDGET_H

#include <QMainWindow>
#include <QMouseEvent>

class FramelessWidget : public QMainWindow
{
    Q_OBJECT
public:
    explicit FramelessWidget(QWidget *parent = nullptr,int y_num = 30);

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
private:
    bool dragging = false;
    QPoint dragPosition;
    int y_num; //顶部可移动区域高度

};

#endif // FRAMELESSWIDGET_H
